import axios from 'axios';
const instance = axios.create({
  baseURL: 'http://8.142.4.230:8886/',
  timeout: 10000,
})
export const get2 = (url, params = {}) => {
  return new Promise((resolve, reject) => {
    instance.get(url, {params}).then((response) => {
      resolve(response.data)
    }, err => {
      reject(err)
    })
  })
}
export const post2 = (url, data = {}) => {
  return new Promise((resolve, reject) => {
    instance.post(url, data, {
      headers: {
        'Content-Type': 'multipart/form-data'
      }
    }).then(response => {
      resolve(response.data)
    }, err => {
      reject(err)
    })
  })
}

